layui.use(['table', 'layer', 'form', 'admin', 'ax'], function () {
    var $ = layui.jquery;
    var layer = layui.layer;
    var form = layui.form;
    var admin = layui.admin;
    var table = layui.table;
    var $ax = layui.ax;

    // 让当前iframe弹层高度适应
    admin.iframeAuto();

    // 监听提交
    form.on('submit(submit)', function (data) {
        var ajax = new $ax(Feng.ctxPath + "/"+Feng.getUrlParam("u")+"/delete", function (data) {
            Feng.success("操作成功!");
            window.parent.reloadPage(data);
            admin.closeThisDialog();
        }, function (data) {
            Feng.error("操作失败!" + data.responseJSON.message + "!");
        });
        ajax.set("id", Feng.getUrlParam("id"));
        ajax.set("cancelReason", data.field.cancelReason);
        ajax.start();

        //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        return false;
    });

});
